package com.test.service.impl;

import java.util.List;

import com.test.dao.RoleDao;
import com.test.domain.Role;
import com.test.service.RoleService;

public class RoleServiceImpl implements RoleService {
	//从容器中获取roleDao实例
	private RoleDao roleDao;
	public RoleDao getRoleDao() {
		return roleDao;
	}

	public void setRoleDao(RoleDao roleDao) {
		this.roleDao = roleDao;
	}
	
	/**
	 * 实现分页查询
	 */
	public List<Role> SearchRole(Role role, int firstResult, int maxResults) {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean addRole(Role role) {
		// TODO Auto-generated method stub
		return roleDao.add(role);
	}

	public boolean deleteRole(Integer id) {
		// TODO Auto-generated method stub
		return roleDao.delete(id);
	}

	public Role findRoleById(Integer id) {
		// TODO Auto-generated method stub
		return roleDao.getById(id);
	}
	public List<Role> findRoleByIds(Integer[] ids){
		return roleDao.getByIds(ids);
	}
	public boolean updateRole(Role role) {
		// TODO Auto-generated method stub
		return roleDao.update(role);
	}

	public List<Role> findAll() {
		// TODO Auto-generated method stub
		return roleDao.findAll();
	}

}
